package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.ShippingDetailsMapper;
import com.hello.system.domain.ShippingDetails;
import com.hello.system.service.IShippingDetailsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 纸质信件邮寄信息Service业务层处理
 * 
 * @author hello
 * @date 2025-05-15
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ShippingDetailsServiceImpl extends ServiceImpl<ShippingDetailsMapper, ShippingDetails> implements IShippingDetailsService 
{
    private final ShippingDetailsMapper shippingDetailsMapper;

    /**
     * 查询纸质信件邮寄信息
     * 
     * @param shippingId 纸质信件邮寄信息主键
     * @return 纸质信件邮寄信息
     */
    @Override
    public ShippingDetails selectShippingDetailsByShippingId(Long shippingId)
    {
        return shippingDetailsMapper.selectShippingDetailsByShippingId(shippingId);
    }

    /**
     * 查询纸质信件邮寄信息列表
     * 
     * @param shippingDetails 纸质信件邮寄信息
     * @return 纸质信件邮寄信息
     */
    @Override
    public List<ShippingDetails> selectShippingDetailsList(ShippingDetails shippingDetails)
    {
        return shippingDetailsMapper.selectShippingDetailsList(shippingDetails);
    }

    /**
     * 新增纸质信件邮寄信息
     * 
     * @param shippingDetails 纸质信件邮寄信息
     * @return 结果
     */
    @Override
    public int insertShippingDetails(ShippingDetails shippingDetails)
    {
        shippingDetails.setCreateTime(DateUtils.getNowDate());
        return shippingDetailsMapper.insertShippingDetails(shippingDetails);
    }

    /**
     * 修改纸质信件邮寄信息
     * 
     * @param shippingDetails 纸质信件邮寄信息
     * @return 结果
     */
    @Override
    public int updateShippingDetails(ShippingDetails shippingDetails)
    {
        shippingDetails.setUpdateTime(DateUtils.getNowDate());
        return shippingDetailsMapper.updateShippingDetails(shippingDetails);
    }


    /**
     * 批量删除纸质信件邮寄信息
     * 
     * @param shippingIds 需要删除的纸质信件邮寄信息主键
     * @return 结果
     */
    @Override
    public int deleteShippingDetailsByShippingIds(Long[] shippingIds)
    {
        return shippingDetailsMapper.deleteShippingDetailsByShippingIds(shippingIds);
    }

    /**
     * 删除纸质信件邮寄信息信息
     * 
     * @param shippingId 纸质信件邮寄信息主键
     * @return 结果
     */
    @Override
    public int deleteShippingDetailsByShippingId(Long shippingId)
    {
        return shippingDetailsMapper.deleteShippingDetailsByShippingId(shippingId);
    }
}
